Repository navigation
Docs: fix built-in function __self__ attribute descriptions - #159653
Conversation
Since PEP 3121, functions in C modules are bound to their module, so their __self__ is the module object. The inspect.isbuiltin docstring, the inspect attribute table and the data model reference still say it is None, as it was in Python 2. Describe it as the module object the function was defined in, or None.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Documentation build overview
|
|
Thanks @crypt0lith for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
GH-159710 is a backport of this pull request to the 3.15 branch. |
|
GH-159711 is a backport of this pull request to the 3.14 branch. |
…H-159653) (GH-159710) Since PEP 3121, functions in C modules are bound to their module, so their __self__ is the module object. The inspect.isbuiltin docstring, the inspect attribute table and the data model reference still say it is None, as it was in Python 2. Describe it as the module object the function was defined in, or None. (cherry picked from commit 415ebff) Co-authored-by: crypt0lith <118923461+crypt0lith@users.noreply.github.com>
|
|
…H-159653) (GH-159711) Since PEP 3121, functions in C modules are bound to their module, so their __self__ is the module object. The inspect.isbuiltin docstring, the inspect attribute table and the data model reference still say it is None, as it was in Python 2. Describe it as the module object the function was defined in, or None. (cherry picked from commit 415ebff) Co-authored-by: crypt0lith <118923461+crypt0lith@users.noreply.github.com>
|
Since PEP 3121 (1a21451), functions in C modules are created with their module as
self. Theinspect.isbuiltindocstring, theinspectattribute table and the data model reference still say a built-in function's__self__isNone, as it was in Python 2.Describe it as the module object the function was defined in, or
None, mirroring__module__. It can still beNonefor built-in functions not defined in a module, such as the codec error handlers returned bycodecs.lookup_error().